package com.pluszg.nutrition.common.exception;

import com.pluszg.nutrition.common.resp.ResponseCode;

/**
 * 自定义异常
 */
public class PlusException extends RuntimeException {

    private int code;

    private Object object;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public Object getObject() {
        return object;
    }

    public void setObject(Object object) {
        this.object = object;
    }

    public PlusException() {
        this(ResponseCode.INTERNAL_ERROR);
    }

    public PlusException(int code) {
        this(code, null);
    }

    public PlusException(String message) {
        this(ResponseCode.INTERNAL_ERROR, message);
    }

    public PlusException(int code, String message) {
        this(code, message, null);
    }

    public PlusException(int code, String message, Object object) {
        super(message);
        this.code = code;
        this.object = object;
    }
}
